package com.penngo.gui.dfdiff.view;

import java.awt.*;
import java.io.File;

/**
 * 文本编辑
 */
public class DesktopFrameEditor extends DesktopFrame{

    private FileEditorPanel Editor;

    public DesktopFrameEditor(ProjectNode node) {
        super(node);
        File file = node.getPathLeft();
        Editor = new FileEditorPanel(file);
        this.getContentPane().add(Editor);
    }

    public FileEditorPanel getEditor() {
        return Editor;
    }

    public void undo(){
        getEditor().getTextArea().undoLastAction();
    }
    public void redo(){
        getEditor().getTextArea().redoLastAction();
    }
    public void copy(){
        getEditor().getTextArea().copy();
    }
    public void paste(){
        getEditor().getTextArea().paste();
    }
    public void cut(){
        getEditor().getTextArea().cut();
    }
    public void find(){
        getEditor().setFindBarVisiable(true);

    }
    public void setLineWrap(boolean b){
        getEditor().getTextArea().setLineWrap(b);
    }
    public void updateFont(Font font){
        getEditor().getTextArea().setFont(font);
    }
}
